<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<fmt:setBundle basename="messages.messages"/>

<html>
<head>

<link rel="stylesheet" href="/Epics/jslib/global.css" />
<script src="/Epics/jslib/jquery-1.9.1.js"></script>
<script src="/Epics/jslib/jquery.validate.min.js"></script>

<script type="text/javascript">
	$(document).ready(
			function() {

				$("#inputForm").validate({
					rules : {
						profilePicture : {
							required : true,
							accept:"jpg,png,jpeg,gif"
						}
					},
					messages : {
						profilePicture:{
							required : "Choose a file."
						}
					}
				});
			
			});
</script>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><fmt:message key="siteName"/></title>
</head>
<body>
	<%@ include file="../Template/TMainLine.jsp" %>
	<%@ include file="../Template/TMessage.jsp"%>
	
	<p>Current picture:</p>
	<c:if test="${!empty profilePicture}">
		<br/><img src=".${profilePicture.location }"/>
	</c:if>
	<c:if test="${empty profilePicture}">
		<p>There is no profile picture</p><br/>
	</c:if>
	<form id="inputForm" action="SChangeProfilePictureOut" accept-charset="UFT-8" method="post" enctype="multipart/form-data">
		Add profile image:<br/>
		<input type="file" name="profilePicture" accept="image/*"/><br/>
		<input type="submit" value="Add image"/>
	</form>
</body>
</html>